﻿#ifndef THREADDATAPRO_H
#define THREADDATAPRO_H

#include <QObject>
#include <QThread>
#include "qlist.h"
using namespace std;
class ThreadDataPro : public QThread
{
    Q_OBJECT
public:
    explicit ThreadDataPro(QObject *parent = nullptr);
    void SelMacSend(QString Mac);
    void setDeviceMacs(QList<QString>macs);
    void setSaveState();
    void SetRunStop(){
        RunFlag=false;
    }
    void SaveData();

//    void SaveData2(int No,QList<double>ecg,QList<double>tempture,QList<double>j1,QList<double>j2,QList<double>j3,QList<double>DL);
protected:
    void run(); // 线程入口
signals:
    void sendTransData(double irdata,QString Mac);
    void sendIndex(QList<double>index,int deviceNo);
    void sendJDIndex(double jd1,double jd2,double jd3,int deviceNo);
    void sendbufferdata(char*buffer,int Len);
    void sendSaveOver();

public slots:
    void getData(char*buffer,int bufferLen);
//    void getUserInfo(QList<UserInfoAndDeviceInfo>l);
    void getUserAndDevInfo(QString UserName,int deviceNo);

private:

    QString MeasureTime;
    QString SelMac;
    QList<QString>Macs;
    bool RunFlag=true;



};

#endif // THREADDATAPRO_H
